// 引入mongoose
const mongoose = require('mongoose');

// 创建一个文档对象结构
let UserSchema = new mongoose.Schema({
    username: {
        type: String,
        required: true
    },
    password: {
        type: String,
        required: true
    }
})

// 创建一个模型对象 用来操作集合
let UserModel = mongoose.model('user', UserSchema);

module.exports = UserModel;